org.eclipse.vtp.framework.engine.support
Class SessionContextWrapper

java.lang.Object
  extended by org.eclipse.vtp.framework.engine.support.SessionContextWrapper
All Implemented Interfaces:
IContext, ILogger, IProcessContext, IReporter, ISessionContext

public abstract class SessionContextWrapper
extends java.lang.Object
implements ISessionContext

A wrapper for the ISessionContext interface.

Author:
Lonnie Pryor

Field Summary
 
Fields inherited from interface org.eclipse.vtp.framework.core.IReporter
SEVERITY_DEBUG, SEVERITY_ERROR, SEVERITY_INFO, SEVERITY_WARN
 
Constructor Summary
protected SessionContextWrapper()
          Creates a new SessionContextWrapper.
 
Method Summary
 void clearAttribute(java.lang.String attributeName)
          Clears the value of a session-level attribute.
 void debug(java.lang.String message)
          Creates and publishes a debug log entry with the specified attributes.
 void debug(java.lang.String[] categories, java.lang.String message)
          Creates and publishes a debug log entry with the specified attributes.
 void debug(java.lang.String[] categories, java.lang.String message, java.util.Dictionary properties)
          Creates and publishes a debug log entry with the specified attributes.
 void debug(java.lang.String message, java.util.Dictionary properties)
          Creates and publishes a debug log entry with the specified attributes.
 void error(java.lang.String message)
          Creates and publishes an error log entry with the specified attributes.
 void error(java.lang.String[] categories, java.lang.String message)
          Creates and publishes an error log entry with the specified attributes.
 void error(java.lang.String[] categories, java.lang.String message, java.util.Dictionary properties)
          Creates and publishes an error log entry with the specified attributes.
 void error(java.lang.String message, java.util.Dictionary properties)
          Creates and publishes an error log entry with the specified attributes.
 java.lang.Object getAttribute(java.lang.String attributeName)
          Returns the value of a session-level attribute with the specified name or null if no such attribute exists.
 java.lang.String[] getAttributeNames()
          Returns the names of all the session-level attributes currently registered.
 java.lang.String getProcessID()
          Returns the ID of this process.
 java.lang.Object getProperty(java.lang.String propertyName)
          Returns the value of the process-level configuration property with the specified name or null if no such property exists.
protected abstract  ISessionContext getSessionContext()
          Returns the wrapped session context.
 java.lang.String getSessionID()
          Returns the ID of the current session.
 void info(java.lang.String message)
          Creates and publishes an informational log entry with the specified attributes.
 void info(java.lang.String[] categories, java.lang.String message)
          Creates and publishes an informational log entry with the specified attributes.
 void info(java.lang.String[] categories, java.lang.String message, java.util.Dictionary properties)
          Creates and publishes an informational log entry with the specified attributes.
 void info(java.lang.String message, java.util.Dictionary properties)
          Creates and publishes an informational log entry with the specified attributes.
 boolean isDebugEnabled()
          Returns true if the debug severity level is enabled.
 boolean isErrorEnabled()
          Returns true if the error severity level is enabled.
 boolean isInfoEnabled()
          Returns true if the informational severity level is enabled.
protected  boolean isReservedIdentifier(java.lang.String identifier)
          Returns true if the specified identifier is implemented by the context.
 boolean isSeverityEnabled(int severity)
          Returns true if the specified severity level is enabled.
 boolean isWarnEnabled()
          Returns true if the warning severity level is enabled.
 java.lang.Class loadClass(java.lang.String className)
          Loads a class visible to the process.
 void log(int severity, java.lang.String message)
          Creates and publishes a log entry with the specified attributes.
 void log(int severity, java.lang.String[] categories, java.lang.String message)
          Creates and publishes a log entry with the specified attributes.
 void log(int severity, java.lang.String[] categories, java.lang.String message, java.util.Dictionary properties)
          Creates and publishes a log entry with the specified attributes.
 void log(int severity, java.lang.String message, java.util.Dictionary properties)
          Creates and publishes a log entry with the specified attributes.
 java.lang.Object lookup(java.lang.String identifier)
          Looks up the service selected for the specified identifier or null if no such service exists.
 java.lang.Object[] lookupAll(java.lang.String identifier)
          Returns an array containing all the services registered under the specified identifier.
 void report(int severity, java.lang.String message)
          Creates and publishes a reporting entry with the specified attributes.
 void report(int severity, java.lang.String[] categories, java.lang.String message)
          Creates and publishes a reporting entry with the specified attributes.
 void report(int severity, java.lang.String[] categories, java.lang.String message, java.util.Dictionary properties)
          Creates and publishes a reporting entry with the specified attributes.
 void report(int severity, java.lang.String message, java.util.Dictionary properties)
          Creates and publishes a reporting entry with the specified attributes.
 void setAttribute(java.lang.String attributeName, java.lang.Object attributeValue)
          Sets the value of a session-level attribute or clears it if the supplied value is null.
 void warn(java.lang.String message)
          Creates and publishes a warning log entry with the specified attributes.
 void warn(java.lang.String[] categories, java.lang.String message)
          Creates and publishes a warning log entry with the specified attributes.
 void warn(java.lang.String[] categories, java.lang.String message, java.util.Dictionary properties)
          Creates and publishes a warning log entry with the specified attributes.
 void warn(java.lang.String message, java.util.Dictionary properties)
          Creates and publishes a warning log entry with the specified attributes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionContextWrapper

protected SessionContextWrapper()
Creates a new SessionContextWrapper.

Method Detail

isReservedIdentifier

protected boolean isReservedIdentifier(java.lang.String identifier)
Returns true if the specified identifier is implemented by the context.

Parameters:
identifier - The identifier to check.
Returns:
True if the specified identifier is implemented by the context.

getSessionContext

protected abstract ISessionContext getSessionContext()
Returns the wrapped session context.

Returns:
The wrapped session context.

isSeverityEnabled

public boolean isSeverityEnabled(int severity)
Description copied from interface: IReporter
Returns true if the specified severity level is enabled.

Specified by:
isSeverityEnabled in interface IReporter
Parameters:
severity - The severity to check.
Returns:
True if the specified severity level is enabled.

report

public void report(int severity,
                   java.lang.String message)
Description copied from interface: IReporter
Creates and publishes a reporting entry with the specified attributes.

Specified by:
report in interface IReporter
Parameters:
severity - The severity of the report.
message - The message associated with the report or null to not include a message.

report

public void report(int severity,
                   java.lang.String message,
                   java.util.Dictionary properties)
Description copied from interface: IReporter
Creates and publishes a reporting entry with the specified attributes.

Specified by:
report in interface IReporter
Parameters:
severity - The severity of the report.
message - The message associated with the report or null to not include a message.
properties - The properties of the report or null if no properties are specified.

report

public void report(int severity,
                   java.lang.String[] categories,
                   java.lang.String message)
Description copied from interface: IReporter
Creates and publishes a reporting entry with the specified attributes.

Specified by:
report in interface IReporter
Parameters:
severity - The severity of the report.
categories - The categories the report pertains to or null if no catagories are related.
message - The message associated with the report or null to not include a message.

report

public void report(int severity,
                   java.lang.String[] categories,
                   java.lang.String message,
                   java.util.Dictionary properties)
Description copied from interface: IReporter
Creates and publishes a reporting entry with the specified attributes.

Specified by:
report in interface IReporter
Parameters:
severity - The severity of the report.
categories - The categories the report pertains to or null if no catagories are related.
message - The message associated with the report or null to not include a message.
properties - The properties of the report or null if no properties are specified.

log

public void log(int severity,
                java.lang.String message)
Description copied from interface: ILogger
Creates and publishes a log entry with the specified attributes.

Specified by:
log in interface ILogger
Parameters:
severity - The severity of the log entry.
message - The message associated with the log entry or null to not include a message.

log

public void log(int severity,
                java.lang.String message,
                java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes a log entry with the specified attributes.

Specified by:
log in interface ILogger
Parameters:
severity - The severity of the log entry.
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

log

public void log(int severity,
                java.lang.String[] categories,
                java.lang.String message)
Description copied from interface: ILogger
Creates and publishes a log entry with the specified attributes.

Specified by:
log in interface ILogger
Parameters:
severity - The severity of the log entry.
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.

log

public void log(int severity,
                java.lang.String[] categories,
                java.lang.String message,
                java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes a log entry with the specified attributes.

Specified by:
log in interface ILogger
Parameters:
severity - The severity of the log entry.
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

isErrorEnabled

public boolean isErrorEnabled()
Description copied from interface: ILogger
Returns true if the error severity level is enabled.

Specified by:
isErrorEnabled in interface ILogger
Returns:
True if the error severity level is enabled.

error

public void error(java.lang.String message)
Description copied from interface: ILogger
Creates and publishes an error log entry with the specified attributes.

Specified by:
error in interface ILogger
Parameters:
message - The message associated with the log entry or null to not include a message.

error

public void error(java.lang.String message,
                  java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes an error log entry with the specified attributes.

Specified by:
error in interface ILogger
Parameters:
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

error

public void error(java.lang.String[] categories,
                  java.lang.String message)
Description copied from interface: ILogger
Creates and publishes an error log entry with the specified attributes.

Specified by:
error in interface ILogger
Parameters:
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.

error

public void error(java.lang.String[] categories,
                  java.lang.String message,
                  java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes an error log entry with the specified attributes.

Specified by:
error in interface ILogger
Parameters:
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

isWarnEnabled

public boolean isWarnEnabled()
Description copied from interface: ILogger
Returns true if the warning severity level is enabled.

Specified by:
isWarnEnabled in interface ILogger
Returns:
True if the warning severity level is enabled.

warn

public void warn(java.lang.String message)
Description copied from interface: ILogger
Creates and publishes a warning log entry with the specified attributes.

Specified by:
warn in interface ILogger
Parameters:
message - The message associated with the log entry or null to not include a message.

warn

public void warn(java.lang.String message,
                 java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes a warning log entry with the specified attributes.

Specified by:
warn in interface ILogger
Parameters:
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

warn

public void warn(java.lang.String[] categories,
                 java.lang.String message)
Description copied from interface: ILogger
Creates and publishes a warning log entry with the specified attributes.

Specified by:
warn in interface ILogger
Parameters:
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.

warn

public void warn(java.lang.String[] categories,
                 java.lang.String message,
                 java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes a warning log entry with the specified attributes.

Specified by:
warn in interface ILogger
Parameters:
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

isInfoEnabled

public boolean isInfoEnabled()
Description copied from interface: ILogger
Returns true if the informational severity level is enabled.

Specified by:
isInfoEnabled in interface ILogger
Returns:
True if the informational severity level is enabled.

info

public void info(java.lang.String message)
Description copied from interface: ILogger
Creates and publishes an informational log entry with the specified attributes.

Specified by:
info in interface ILogger
Parameters:
message - The message associated with the log entry or null to not include a message.

info

public void info(java.lang.String message,
                 java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes an informational log entry with the specified attributes.

Specified by:
info in interface ILogger
Parameters:
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

info

public void info(java.lang.String[] categories,
                 java.lang.String message)
Description copied from interface: ILogger
Creates and publishes an informational log entry with the specified attributes.

Specified by:
info in interface ILogger
Parameters:
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.

info

public void info(java.lang.String[] categories,
                 java.lang.String message,
                 java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes an informational log entry with the specified attributes.

Specified by:
info in interface ILogger
Parameters:
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

isDebugEnabled

public boolean isDebugEnabled()
Description copied from interface: ILogger
Returns true if the debug severity level is enabled.

Specified by:
isDebugEnabled in interface ILogger
Returns:
True if the debug severity level is enabled.

debug

public void debug(java.lang.String message)
Description copied from interface: ILogger
Creates and publishes a debug log entry with the specified attributes.

Specified by:
debug in interface ILogger
Parameters:
message - The message associated with the log entry or null to not include a message.

debug

public void debug(java.lang.String message,
                  java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes a debug log entry with the specified attributes.

Specified by:
debug in interface ILogger
Parameters:
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

debug

public void debug(java.lang.String[] categories,
                  java.lang.String message)
Description copied from interface: ILogger
Creates and publishes a debug log entry with the specified attributes.

Specified by:
debug in interface ILogger
Parameters:
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.

debug

public void debug(java.lang.String[] categories,
                  java.lang.String message,
                  java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes a debug log entry with the specified attributes.

Specified by:
debug in interface ILogger
Parameters:
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

lookup

public java.lang.Object lookup(java.lang.String identifier)
                        throws java.lang.NullPointerException
Description copied from interface: IContext
Looks up the service selected for the specified identifier or null if no such service exists.

Specified by:
lookup in interface IContext
Parameters:
identifier - The identifier of the service to look up.
Returns:
The service selected for the specified identifier or null if no such service exists.
Throws:
java.lang.NullPointerException - If the supplied identifier is null.

lookupAll

public java.lang.Object[] lookupAll(java.lang.String identifier)
                             throws java.lang.NullPointerException
Description copied from interface: IContext
Returns an array containing all the services registered under the specified identifier.

Specified by:
lookupAll in interface IContext
Parameters:
identifier - The identifier of the services to look up.
Returns:
An array containing all the services registered under the specified identifier.
Throws:
java.lang.NullPointerException - If the supplied identifier is null.

getProcessID

public java.lang.String getProcessID()
Description copied from interface: IProcessContext
Returns the ID of this process.

Specified by:
getProcessID in interface IProcessContext
Returns:
The ID of this process.

getProperty

public java.lang.Object getProperty(java.lang.String propertyName)
                             throws java.lang.NullPointerException
Description copied from interface: IProcessContext
Returns the value of the process-level configuration property with the specified name or null if no such property exists.

Specified by:
getProperty in interface IProcessContext
Parameters:
propertyName - The name of the configuration property to return.
Returns:
The value of the process-level configuration property with the specified name or null if no such property exists.
Throws:
java.lang.NullPointerException - If the supplied property name is null.

loadClass

public java.lang.Class loadClass(java.lang.String className)
                          throws java.lang.ClassNotFoundException,
                                 java.lang.NullPointerException
Description copied from interface: IProcessContext
Loads a class visible to the process.

Specified by:
loadClass in interface IProcessContext
Parameters:
className - The name of the class to load.
Returns:
The requested class instance.
Throws:
java.lang.ClassNotFoundException - If a class with the specified name cannot be found.
java.lang.NullPointerException - If the supplied class name is null.

getSessionID

public java.lang.String getSessionID()
Description copied from interface: ISessionContext
Returns the ID of the current session.

Specified by:
getSessionID in interface ISessionContext
Returns:
The ID of the current session.

getAttributeNames

public java.lang.String[] getAttributeNames()
Description copied from interface: ISessionContext
Returns the names of all the session-level attributes currently registered.

Specified by:
getAttributeNames in interface ISessionContext
Returns:
The names of all the session-level attributes currently registered.

getAttribute

public java.lang.Object getAttribute(java.lang.String attributeName)
                              throws java.lang.NullPointerException
Description copied from interface: ISessionContext
Returns the value of a session-level attribute with the specified name or null if no such attribute exists.

Specified by:
getAttribute in interface ISessionContext
Parameters:
attributeName - The name of the session attribute to return.
Returns:
The value of a session-level attribute with the specified name or null if no such attribute exists.
Throws:
java.lang.NullPointerException - If the supplied attribute name is null.

setAttribute

public void setAttribute(java.lang.String attributeName,
                         java.lang.Object attributeValue)
                  throws java.lang.NullPointerException
Description copied from interface: ISessionContext
Sets the value of a session-level attribute or clears it if the supplied value is null.

Specified by:
setAttribute in interface ISessionContext
Parameters:
attributeName - The name of the session attribute to set.
attributeValue - The value to set the attribute to or null to clear the attribute.
Throws:
java.lang.NullPointerException - If the supplied attribute name is null.

clearAttribute

public void clearAttribute(java.lang.String attributeName)
                    throws java.lang.NullPointerException
Description copied from interface: ISessionContext
Clears the value of a session-level attribute.

Specified by:
clearAttribute in interface ISessionContext
Parameters:
attributeName - The name of the session attribute to clear.
Throws:
java.lang.NullPointerException - If the supplied attribute name is null.